package com.gegewa.topic.dynamicdatasource.controller;

import com.gegewa.topic.dynamicdatasource.dao.StudentDao;
import com.gegewa.topic.dynamicdatasource.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Controller
public class StudentController {

    @Resource
    private StudentDao studentDao;

    @RequestMapping(value = "/getStudentList", method = RequestMethod.POST)
    @ResponseBody
    public List<Student> getStudentList() {
        List<Student> studentList = studentDao.selectList(Collections.emptyMap());
        return studentList;
    }

}
